package cn.eli.vue.service.user.impl;

import cn.eli.vue.entity.User;
import cn.eli.vue.mapper.user.UserMapper;
import cn.eli.vue.service.user.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * @author :lzs
 * @Date : 2021年7月13日
 * @Description : 对service层接口的实现：UserServiceImpl.java
 */

@Service("UserService")
public class UserServiceImpl implements UserService {
    @Autowired
    UserMapper userMappper;//实现的mapper层接口

    /**
     * @author : lzs
     * @Description :业务类接口
     */
    /* 登录抽象接口实现入口*/
    @Override
    public User Login(String user_loginNum,String user_password){
        return userMappper.Login(user_loginNum,user_password);
    }
    /*注册抽象接口实现入口*/
    @Override
    public int Register(String user_name, String user_loginNumber, String user_password, int user_sex, String user_avaturl){
        return userMappper.Register(user_name,user_loginNumber,user_password,user_sex,user_avaturl);
    }
    /*修改用户信息接口*/
    public int Modify(int user_id,String user_name, String user_loginNumber, String user_password, int user_sex, String user_avaturl){
        return userMappper.Modify( user_id,user_name,  user_loginNumber,  user_password,  user_sex,  user_avaturl);
    }

    /**
     * @author : lzs
     * @Description :工具接口
     */
    /*用户名重复验证接口*/
    public User IsUsernameRepeat(String user_name){
        return userMappper.IsUsernameRepeat(user_name);
    }
    /*用户登录账号重复验证接口*/
    public User IsUserLoginNumberRepeat(String user_loginNumber){
        return userMappper.IsUserLoginNumberRepeat(user_loginNumber);
    }
    /*用户从用户名检索用户实体*/
    public User usernameToUser(String user_name){
        return userMappper.UsernameToUser(user_name);
    }
}
